[WIP] feat(git-init): add -lfs flag to pull Git LFS objects (DEVOPS-44388) - #23
Draft
l-qing wants to merge 1 commit into
Draft
[WIP] feat(git-init): add -lfs flag to pull Git LFS objects (DEVOPS-44388)#23l-qing wants to merge 1 commit into
l-qing wants to merge 1 commit into
Conversation
Add an opt-in -lfs flag (default false). When enabled, after the checkout and submodule update, run `git lfs install --local` and `git lfs pull` so LFS-tracked files are materialised into real content instead of pointer files, reusing the already-configured origin, credentials and proxy. Refs: DEVOPS-44388
Author
|
Companion Task wiring PR: AlaudaDevops/catalog#1031 · Jira: DEVOPS-44388 (https://jira.alauda.cn/browse/DEVOPS-44388). WIP/reference only. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this does
Adds opt-in Git LFS support to
git-initso thegit-cloneTask can materialise LFS-tracked files into their real content instead of leaving LFS pointer files in the working tree.-lfsflag (defaultfalse) inmain.go.FetchSpec.LFS+lfsFetch()ingit/git.go: after checkout (including submodules), rungit lfs install --localthengit lfs pull, reusing the already-configuredorigin, credentials and proxy settings.Verified locally
go vet/go build/ existing unit tests all green.-lfs=truethe working tree gets the real object content (sha256 matches the source), exit 0; with-lfs=false(default) the file stays an LFS pointer — behaviour byte-for-byte unchanged.cgr.dev/chainguard/gitalready shipsgit-lfs(3.7.1), so no base-image change is required.NOT done yet (why this is WIP)
git/git_test.go) — only an external integration test was run.Rollout ordering (important)
The git-init image must be rebuilt and published first; only then can the catalog
git-cloneTask'slfs=truework in-cluster. Passing-lfsto an image that predates this flag fails (Go's flag parser exits non-zero). The companion Task change already guards against this by only appending-lfswhen explicitly enabled.Context
git-cloneTask): tracked in the Jira ticket below.